#pragma once
#include "CGradientBrush.h"

class CLinearGradientBrush :
	public CGradientBrush
{

protected: 
	CLinearGradientBrush(const CLinearGradientBrush &, HRESULT &);
private: 
	CLinearGradientBrush(CCoreServices *);
private: 
	virtual ~CLinearGradientBrush();
public: 
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
	virtual XUINT32 GetTypeIndex() const;
	XUINT32 CanProduceLinearGradientBrushSpan();
	virtual HRESULT Clone(CNoParentShareableDependencyObject * * ppClone);
	HRESULT CreateBrushSpan(const CMILMatrix *, const struct XRECTF_WH *, XUINT32, struct IBrushSpan * *);
	virtual HRESULT CreateBrushSpan(const CMILMatrix * pWorldTransform, const struct XRECTF_WH * pBrushBounds, struct IBrushSpan * * ppBrushSpan);

	struct XPOINTF m_ptStart;
	struct XPOINTF m_ptEnd;


	XUINT32 m_requestedTexels;
	XUINT32 GetRequestedTexelCount(XUINT32 * pTexelCount);
	struct IPALSurface * GetRenderingCache();
	void SetRenderingCache(struct IPALSurface * pRenderingCache);
	void ReleaseRenderingCache();
private: 
	struct IPALSurface * m_pRenderingCache;
public: 
	virtual HRESULT D2DEnsureDeviceIndependentResources(const struct D2DPrecomputeParams & cp, const CMILMatrix * pMyAccumulatedTransform, const struct XRECTF_RB * pBrushBounds, struct AcceleratedBrushParams * pPALBrushParams);
	virtual HRESULT UpdateAcceleratedBrush(const struct D2DRenderParams & renderParams);
private: 
	HRESULT CreateAcceleratedBrush(const struct D2DRenderParams & renderParams, struct IPALAcceleratedBrush * * ppBrush);
public: 
	virtual HRESULT GetPrintBrush(const struct D2DRenderParams & printParams, struct IPALAcceleratedBrush * * ppBrush);
	virtual void NWPropagateDirtyFlag(enum DirtyFlags::Value flag);


};